import { Injectable } from '@angular/core';
import {Observable} from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
@Injectable()
export class MesService {

    constructor() { }
    private subject=new Subject<any>()

    sendMessage(msg:string){
        this.subject.next(msg)
    }

    clearMessage(){
        this.subject.next()
    }

    getMessage():Observable<any>{
        return this.subject.asObservable()
    }
}
